const db = useDatabase()

export function db_init() {
    db.sql`
    CREATE TABLE IF NOT EXISTS [task-list] (
    [id] TEXT PRIMARY KEY NOT NULL,
    [name] TEXT NOT NULL,
    [cron] TEXT NOT NULL,
    [webhook] TEXT NOT NULL,
    [secret] TEXT NOT NULL,
    [template_id] TEXT NOT NULL,
    [template_variables] TEXT NOT NULL,
    [status] INTEGER NOT NULL DEFAULT 1
    )`
    db.sql`
    CREATE TABLE IF NOT EXISTS [variable-list] (
    [id] TEXT PRIMARY KEY NOT NULL,
    [name] TEXT NOT NULL,
    [content] TEXT NOT NULL
    )`
    db.sql`
    CREATE TABLE IF NOT EXISTS [crontime-list] (
    [id] TEXT PRIMARY KEY NOT NULL,
    [name] TEXT NOT NULL,
    [cron] TEXT NOT NULL
    )`
}